package cn.buk.api.ctrip.dto.share;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

/**
 * 国际公布运价
 * Created by yfdai on 16/1/22.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="PublishFareInfo")
public class IntlPublishFareInfo extends IntlBaseFareInfo {

    @XmlAttribute(name = "FareID")
    private String fareId;

    /**
     * 文件编号	PolicyID	varchar(50)	自由录入格式，如SHA5700FF500
     */
    @XmlAttribute(name = "PolicyID")
    private String policyId;

    /**
     * 可组文件编号	CombinablePolicyID	varchar(50)	自由录入格式，如SHA5700FF500，当文件编号有值时，可组文件编号必须也要有值
     */
    @XmlAttribute(name = "CombinablePolicyID")
    private String combinablePolicyId;


    /**
     * 行程类型	TripType	char(5)	 OW:单程  RT:往返  BOTH:全部 ，请录入字母，单选
     */
    @XmlAttribute(name = "TripType")
    private String tripType;

    /**
     * 开票航司	Owner	char(2)	航司二字代码，只允许录入一家，要做航司是否存在check
     */
    @XmlAttribute(name = "Owner")
    private String owner;


    /**
     * 出发地	DepCity	varchar(400)	可录入格式：城市三代  如SHA/NYC/SEL       国家二代  如CN/US/KR         大区四代  如SEAS/JPKR/NAME      TC区代码  如TC1/TC2/TC3                                            为空 表示不限制        允许混合录入，可录入多个用/隔开表示多个最多允许录入100个，要做是否存在check
     */
    @XmlAttribute(name = "DepCity")
    private String depCity;


    /**
     * 目的地	ArrCity	varchar(400)	可录入格式：城市三代  如SHA/NYC/SEL       国家二代  如CN/US/KR         大区四代  如SEAS/JPKR/NAME      TC区代码  如TC1/TC2/TC3                                            为空 表示不限制        允许混合录入，可录入多个用/隔开表示多个最多允许录入100个，要做是否存在check
     */
    @XmlAttribute(name = "ArrCity")
    private String arrCity;

    /**
     * 出发地除外	DepCityExcept	varchar(400)	可录入格式：城市三代  如SHA/NYC/SEL       国家二代  如CN/US/KR         大区四代  如SEAS/JPKR/NAME      TC区代码  如TC1/TC2/TC3                                            为空 表示不限制        允许混合录入，可录入多个用/隔开表示多个最多允许录入100个，要做是否存在check
     */
    @XmlAttribute(name = "DepCityExcept")
    private String depCityExcept;

    /**
     * 目的地除外	ArrCityExcept	varchar(400)	可录入格式：城市三代  如SHA/NYC/SEL       国家二代  如CN/US/KR         大区四代  如SEAS/JPKR/NAME      TC区代码  如TC1/TC2/TC3                                            为空 表示不限制        允许混合录入，可录入多个用/隔开表示多个最多允许录入100个，要做是否存在check
     */
    @XmlAttribute(name = "ArrCityExcept")
    private String arrCityExcept ;

    //适用舱位	SeatClass	varchar(100)	舱位代码，可录入多个用/隔开表示多个；为空表示不限制;
    @XmlAttribute(name = "SeatClass")
    private String seatClass ;

    //是否适用于联运	IsInterlineApplicable	bit	是或否（1为是，0为否） 请录入1或者0
    @XmlAttribute(name = "IsInterlineApplicable")
    private String isInterlineApplicable;

    //适用联运航司	InterlineAirlineCode	varchar(40)	航司二字代码，允许录入多个用/隔开表示或的关系，最多允许录入20家航司,可为空表示不限制,要做航司是否存在check
    @XmlAttribute(name = "InterlineAirlineCode")
    private String interlineAirlineCode ;

    //除外联运航司	InterlineAirlineCodeExcept	varchar(40)	航司二字代码，允许录入多个用/隔开表示或的关系，最多允许录入20家航司,可为空表示不限制,要做航司是否存在check
    @XmlAttribute(name = "InterlineAirlineCodeExcept")
    private String interlineAirlineCodeExcept ;


    //是否适用于代码共享航班	IsCSApplicable	tinyint	单选 （0:否,  1:是,  2:不限）
    @XmlAttribute(name = "IsCSApplicable")
    private String isCSApplicable;

    //去程旅行日期	OutboundTravelDate	varchar(200)	2014-11-01>2015-06-01，允许录入多个用/隔开表示或的关系，可为空表示不限制,做日期check
    @XmlAttribute(name = "OutboundTravelDate")
    private String outboundTravelDate ;

    //回程旅行日期	FCInboundTravelDate	varchar(200)	2014-11-01>2015-06-01，允许录入多个用/隔开表示或的关系，可为空表示不限制,做日期check
    @XmlAttribute(name = "FCInboundTravelDate")
    private String fcInboundTravelDate ;


    //销售日期	SalesDate	varchar(30)	2014-11-01>2015-06-01，只允许录入一个,做日期check
    @XmlAttribute(name = "SalesDate")
    private String salesDate ;

    //乘客类型	PassengerType	varchar(20)	三种乘客类型:  成人 /成人陪伴儿童/无座婴儿（请录入：0/1/2），可录入多个用/隔开表示或的关系，可以为空默认全部，请输入数字
    @XmlAttribute(name = "PassengerType")
    private String passengerType ;

    //旅客资质	Eligibility	varchar(20)	五种旅客资质：  普通/留学生/劳工/移民/ 海员（请录入：0/1/2/3/4） 可录入多个用/隔开表示或的关系，可以为空默认全部，请输入数字
    @XmlAttribute(name = "Eligibility")
    private String eligibility ;

    //返点	Commition	decimal(18,2)	整数，最多允许保留两位小数,当返点大于30时提示警告，但是可以继续保存
    @XmlAttribute(name = "Commition")
    private Float commition;

    //留钱	Profit	smallint	只支持正负整数输入；-20表示返20元，20代表留20元 ，当留钱小于-1000时提示警告，但是可以继续保存
    @XmlAttribute(name = "Profit")
    private Integer profit;


    //         1/2RT佣金计算方式	"CommissionCalculation
    //         "	tinyint	单选 （1:取严,  2:各取各     请录入1或者2）
    @XmlAttribute(name = "CommissionCalculation")
    private Integer commissionCalculation;

    //出票时限	TicketingDeadline	varchar(100)	举例0-365,7,3表示至少于预订后7天内出票或起飞前3天前出票
    @XmlAttribute(name = "TicketingDeadline")
    private String ticketingDeadline ;


    //是否适用于中转	IsTransferApplication	tinyint	单选 （0:否,  1:是,  2:不限）
    @XmlAttribute(name = "IsTransferApplication")
    private Integer isTransferApplication;


    //指定转机点	TransferPoint	varchar(200)	城市三字代码，可以录入多个用/隔开表示或的关系，可为空表示不限制，当适用于中转时，指定转机点可以为空
    @XmlAttribute(name = "TransferPoint")
    private String transferPoint ;

    //运价类型	FareType 	tinyint	单选（BSP），请录入字母
    @XmlAttribute(name = "FareType")
    private String fareType ;

    //出票备注	TicketingRemark 	varchar(200)	QTE需使用特使指令QTE：/XXXX
    @XmlAttribute(name = "TicketingRemark")
    private String ticketingRemark ;

    //是否允许缺口	IsAllowOpenJaw 	tinyint	单选 （0:否,  1:是,  2:不限）
    @XmlAttribute(name = "IsAllowOpenJaw")
    private String isAllowOpenJaw;

    //    工作时间	WorkingTime 	varchar(60)	09:00-18:00表示每一天的早上9点到下午6点  09:00MON-18:00FRI表示周一到周五的每天早上9点到下午6点，可以为空，表示不限制
    @XmlAttribute(name = "WorkingTime")
    private String workingTime;

    //    国籍	Nationality	varchar(50)	国家二字代码，可录入多个用/隔开表示或的关系，为空表示不限制
    @XmlAttribute(name = "Nationality")
    private String nationality ;

    //    除外国籍	ExcludeNationality	varchar(50)	国家二字代码，可录入多个用/隔开表示或的关系，为空表示不限制
    @XmlAttribute(name = "ExcludeNationality")
    private String excludeNationality ;

    //供应商编号	AgentID	varchar(50)	票台ID，供应商请输入0即可
    @XmlAttribute(name = "AgentID")
    private String agentId ;


    //    公布是否转私有	IsPrivate	bit	是或否（1为是，0为否） 请录入1或者0
//    公布是否转私有	Bool	是或否（1为是，0为否） 请录入1或者0
    @XmlAttribute(name = "IsPrivate")
//    private int isPrivate;
    private String isPrivate;

    //    退改费用	Penalties	int	当"公布是否转私有"为"是"时，“退改费用”为必填值,必须为1至2位的正整数。该字段为百分比，但不需要录入%符号，录入数字即可
    @XmlAttribute(name = "Penalties")
    private Integer penalties;

    //    是否适用小团价	IsForSmallGroup	tinyint	单选 （0:否,  1:是,  2:不限）
    @XmlAttribute(name = "IsForSmallGroup")
    private String isForSmallGroup;
//
//    是否适用文件公布运价	IsForFilePubFare	tinyint	单选 （0:否,  1:是,  2:不限）
    @XmlAttribute(name = "IsForFilePubFare")
    private String isForFilePubFare;

    //是否有效
    @XmlAttribute(name = "IsActivated")
    private String isActivated;





    public void setAttrValue(int col, String val) {
        switch(col){//通过列数来判断对应插如的字段
            case 0 : this.policyId = val; break;
            case 1 : this.combinablePolicyId = val;break;
            case 2 : this.tripType = parseTripType(val); break;
            case 3 : this.owner = val; break;
            case 4 : this.depCity = val; break;
            case 5 : this.arrCity = val; break;
            case 6 : this.depCityExcept = val; break;
            case 7 : this.arrCityExcept = val; break;
            case 8 : this.seatClass = val; break;
//            case 9 : this.isInterlineApplicable = parseYesOrNo(val); break;
            case 10 : this.interlineAirlineCode = val; break;
            case 11 : this.interlineAirlineCodeExcept = val; break;
            case 12 : this.isTransferApplication = parseYesOrNo(val); break;
            case 13 : this.transferPoint = val; break;
//            case 14 : this.isCSApplicable = parseYesOrNo(val); break;
//            case 15 : this.isAllowOpenJaw = parseYesOrNo(val); break;
            case 16 : this.fareType = val; break;
            case 17 : this.outboundTravelDate = val; break;
            case 18 : this.fcInboundTravelDate = val; break;
            case 19 : this.salesDate = val; break;
            case 20 : this.passengerType = parsePassengerTypes(val); break;
            case 21 : this.eligibility = parseEligibilityTypes(val); break;
            case 22 : this.commition = Float.parseFloat(val); break;
            case 23 : this.profit = parseInt(val); break;
            case 24 : this.ticketingRemark = val; break;
            case 25 : this.workingTime = val; break;
            case 26 : this.nationality = val; break;
            case 27 : this.excludeNationality = val; break;
            case 28 : this.commissionCalculation = parseCommissionCalculation(val); break;
            case 29 : this.ticketingDeadline = val; break;
//            case 30 : this.isPrivate = parseYesOrNo(val); break;
            case 31 : this.penalties = Integer.parseInt(val); break;
//            case 32 : this.isForSmallGroup = parseYesOrNo(val); break;
//            case 33 : this.isForFilePubFare = parseYesOrNo(val); break;
        }
    }


    public String getFareId() {
        return fareId;
    }

    public void setFareId(String fareId) {
        this.fareId = fareId;
    }

    public String getPolicyId() {
        return policyId;
    }

    public void setPolicyId(String policyId) {
        this.policyId = policyId;
    }

    public String getCombinablePolicyId() {
        return combinablePolicyId;
    }

    public void setCombinablePolicyId(String combinablePolicyId) {
        this.combinablePolicyId = combinablePolicyId;
    }

    public String getTripType() {
        return tripType;
    }

    public void setTripType(String tripType) {
        this.tripType = tripType;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public String getDepCity() {
        return depCity;
    }

    public void setDepCity(String depCity) {
        this.depCity = depCity;
    }

    public String getArrCity() {
        return arrCity;
    }

    public void setArrCity(String arrCity) {
        this.arrCity = arrCity;
    }

    public String getDepCityExcept() {
        return depCityExcept;
    }

    public void setDepCityExcept(String depCityExcept) {
        this.depCityExcept = depCityExcept;
    }

    public String getArrCityExcept() {
        return arrCityExcept;
    }

    public void setArrCityExcept(String arrCityExcept) {
        this.arrCityExcept = arrCityExcept;
    }

    public String getSeatClass() {
        return seatClass;
    }

    public void setSeatClass(String seatClass) {
        this.seatClass = seatClass;
    }

    public String getIsInterlineApplicable() {
        return isInterlineApplicable;
    }

    public void setIsInterlineApplicable(String isInterlineApplicable) {
        this.isInterlineApplicable = isInterlineApplicable;
    }

    public String getInterlineAirlineCode() {
        return interlineAirlineCode;
    }

    public void setInterlineAirlineCode(String interlineAirlineCode) {
        this.interlineAirlineCode = interlineAirlineCode;
    }

    public String getInterlineAirlineCodeExcept() {
        return interlineAirlineCodeExcept;
    }

    public void setInterlineAirlineCodeExcept(String interlineAirlineCodeExcept) {
        this.interlineAirlineCodeExcept = interlineAirlineCodeExcept;
    }

    public String getIsCSApplicable() {
        return isCSApplicable;
    }

    public void setIsCSApplicable(String isCSApplicable) {
        this.isCSApplicable = isCSApplicable;
    }

    public String getOutboundTravelDate() {
        return outboundTravelDate;
    }

    public void setOutboundTravelDate(String outboundTravelDate) {
        this.outboundTravelDate = outboundTravelDate;
    }

    public String getFcInboundTravelDate() {
        return fcInboundTravelDate;
    }

    public void setFcInboundTravelDate(String fcInboundTravelDate) {
        this.fcInboundTravelDate = fcInboundTravelDate;
    }

    public String getSalesDate() {
        return salesDate;
    }

    public void setSalesDate(String salesDate) {
        this.salesDate = salesDate;
    }

    public String getPassengerType() {
        return passengerType;
    }

    public void setPassengerType(String passengerType) {
        this.passengerType = passengerType;
    }

    public String getEligibility() {
        return eligibility;
    }

    public void setEligibility(String eligibility) {
        this.eligibility = eligibility;
    }

    public float getCommition() {
        return commition;
    }

    public void setCommition(float commition) {
        this.commition = commition;
    }

    public int getProfit() {
        return profit;
    }

    public void setProfit(int profit) {
        this.profit = profit;
    }

    public int getCommissionCalculation() {
        return commissionCalculation;
    }

    public void setCommissionCalculation(int commissionCalculation) {
        this.commissionCalculation = commissionCalculation;
    }

    public String getTicketingDeadline() {
        return ticketingDeadline;
    }

    public void setTicketingDeadline(String ticketingDeadline) {
        this.ticketingDeadline = ticketingDeadline;
    }

    public int getIsTransferApplication() {
        return isTransferApplication;
    }

    public void setIsTransferApplication(int isTransferApplication) {
        this.isTransferApplication = isTransferApplication;
    }

    public String getTransferPoint() {
        return transferPoint;
    }

    public void setTransferPoint(String transferPoint) {
        this.transferPoint = transferPoint;
    }

    public String getFareType() {
        return fareType;
    }

    public void setFareType(String fareType) {
        this.fareType = fareType;
    }

    public String getTicketingRemark() {
        return ticketingRemark;
    }

    public void setTicketingRemark(String ticketingRemark) {
        this.ticketingRemark = ticketingRemark;
    }

    public String getIsAllowOpenJaw() {
        return isAllowOpenJaw;
    }

    public void setIsAllowOpenJaw(String isAllowOpenJaw) {
        this.isAllowOpenJaw = isAllowOpenJaw;
    }

    public String getWorkingTime() {
        return workingTime;
    }

    public void setWorkingTime(String workingTime) {
        this.workingTime = workingTime;
    }

    public String getNationality() {
        return nationality;
    }

    public void setNationality(String nationality) {
        this.nationality = nationality;
    }

    public String getExcludeNationality() {
        return excludeNationality;
    }

    public void setExcludeNationality(String excludeNationality) {
        this.excludeNationality = excludeNationality;
    }

    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public String getIsPrivate() {
        return isPrivate;
    }

    public void setIsPrivate(String isPrivate) {
        this.isPrivate = isPrivate;
    }

    public String getIsForSmallGroup() {
        return isForSmallGroup;
    }

    public void setIsForSmallGroup(String isForSmallGroup) {
        this.isForSmallGroup = isForSmallGroup;
    }

    public String getIsForFilePubFare() {
        return isForFilePubFare;
    }

    public void setIsForFilePubFare(String isForFilePubFare) {
        this.isForFilePubFare = isForFilePubFare;
    }

    public int getPenalties() {
        return penalties;
    }

    public void setPenalties(int penalties) {
        this.penalties = penalties;
    }

    public String getIsActivated() {
        return isActivated;
    }

    public void setIsActivated(String isActivated) {
        this.isActivated = isActivated;
    }
}
